package com.itlong.cloud.sdk.service;

import com.itlong.cloud.POJO.DTO.sdk.*;
import com.itlong.cloud.POJO.DTO.sdk.jd.JDPassRecordDTO;
import com.itlong.cloud.POJO.PO.DeviceElevatorFloorConfigPO;
import com.itlong.cloud.POJO.PO.DeviceElevatorInfoPO;
import com.itlong.cloud.POJO.VO.jd.JDResultVO;
import com.itlong.cloud.POJO.VO.sdk.CloudElevatorSDKGetByDeviceUniqueVO;
import com.itlong.cloud.POJO.VO.sdk.RobotNoninductiveDeviceUniqueVO;
import com.itlong.cloud.POJO.VO.sdk.RobotNoninductiveHistoryRecordVO;
import com.itlong.cloud.POJO.VO.sdk.SDKDeviceCloudControllerInfoVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.web.bind.annotation.RequestBody;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      云电梯SDK设备服务接口
 * <desc/>
 *
 * @createDate 2018/12/27
 */
public interface ICloudElevatorSDKServerCloudService {

    /**
     * <desc>
     *      查询项目下电梯设备唯一码列表
     * </desc>
     *
     * @param cloudElevatorSDKServerGetElevatorPageDTO 云电梯SDK查询项目下电梯设备唯一码列表DTO
     * @return 云电梯SDK查询项目下电梯设备唯一码列表VO
     * @author wangzhi
     * @createDate 2018/12/27
     */
    List<String> getElevatorPage(CloudElevatorSDKServerGetElevatorPageDTO cloudElevatorSDKServerGetElevatorPageDTO) throws Exception;

    /**
     * <desc>
     *      根据设备唯一码查询电梯信息
     * </desc>
     *
     * @return 根据设备唯一码查询电梯信息VO
     * @author wangzhi
     * @createDate 2018/12/28
     */
    List<CloudElevatorSDKGetByDeviceUniqueVO> getElevatorInfo(CloudElevatorSDKGetByDeviceUniqueDTO cloudElevatorSDKGetByDeviceUniqueDTO) throws Exception;

    /**
     * <desc>
     *      根据设备唯一码查询电梯信息
     * </desc>
     *
     * @return 根据设备唯一码查询电梯信息VO
     * @author Jiaqi.X
     * @createDate 2019/07/17
     */
    List<RobotNoninductiveDeviceUniqueVO> getElevatorInfoForRobot(CloudElevatorSDKGetByDeviceUniqueDTO cloudElevatorSDKGetByDeviceUniqueDTO) throws Exception;

    /**
     * <desc>
     *      发送开门关门指令
     * </desc>
     *
     * @return 标准格式化响应结果
     * @author Juguang.S
     * @createDate 2018/12/28
     */
    void sendOpenAndCloseDoor(CloudElevatorSDKServerSendCommandDTO cloudElevatorSDKServerSendCommandDTO) throws Exception;

    /**
     * <desc>
     *      根据楼层名称获取真实楼层
     * </desc>
     *
     * @param goFloor
     * @param fromFloor
     * @return
     * @author Jiaqi.X
     * @createDate 2018/01/03
     */
    Map<String,Object> getFloorNumByLogicFloor(String goFloor,String fromFloor,String deviceUnique);

    /**
     * <desc>
     *      获取上报的信息
     * </desc>
     *
     * @param appId
     * @param appSecret
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/22
     */
    Map<String,Object> getReportInfo(String appId, String appSecret, String projectId);

    /**
     * <desc>
     *      打开关闭上报状态
     * </desc>
     *
     * @param cloudElevatorSDKStateReportDTO
     * @author jiaqi.X
     * @createDate 2019/01/03
     */
    void setOpenOrCloseStateReport(@RequestBody CloudElevatorSDKStateReportDTO cloudElevatorSDKStateReportDTO) throws IOException;

    /**
     * <desc>
     *      根据楼层名称获取实际楼层和权限标识
     * </desc>
     *
     * @param floors
     * @param deviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/08/15
     */
    Map<String,Object> getFloorNumAndNaturalFloorByLogicFloor(String floors,String deviceUnique);

    /**
     * <desc>
     *      查询群控器的呼梯结果
     * </desc>
     *
     * @param robotId
     * @param deviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/07/17
     */
    String getCallInfo(String robotId,String deviceUnique) throws IOException;

    /**
     * <desc>
     *      查询群控器所绑定的设备
     * </desc>
     *
     * @param controllerDeviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/07/24
     */
    String getDeviceUniqueByControllerDeviceUnique(String controllerDeviceUnique);

    /**
     * <desc>
     *      获取项目下机器人的呼梯记录
     * </desc>
     *
     * @param dto
     * @return
     * @author Jiaqi.X
     * @createDate 2019/07/24
     */
    Page<RobotNoninductiveHistoryRecordVO> getHistoryRecords(RobotNoninductiveHistoryRecordDTO dto) throws Exception;

    /**
     * <desc>
     *      获取云电梯信息
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author Qiang.S
     * @createDate 2020/04/08
     */
    DeviceElevatorInfoPO getElevatorByDeviceUnique(String deviceUnique) throws Exception;

    /**
     * <desc>
     *      根据jd设备号获取云电梯信息
     * </desc>
     *
     * @param jdDeviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/08/03
     */
    DeviceElevatorInfoPO getElevatorByJDDeviceUnique(String jdDeviceUnique);

    /**
     * <desc>
     *     获取楼层信息
     * </desc>
     *
     * @param params
     * @return
     * @author caoshuai
     * @createDate 2020/08/05
     */
    List<DeviceElevatorFloorConfigPO> getFloorInfoByMap(Map<String, Object> params);

    /**
     * <desc>
     * JD打开关闭上报状态
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/08/10
     */
    JDResultVO jdOpenOrCloseStateReport(String deviceUnique, String openOrClose, String deviceId, String appid, String secret);

    /**
     * <desc>
     *      获取云控制器信息
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/08/05
     */
    SDKDeviceCloudControllerInfoVO getDeviceCloudControllerInfo(String deviceUnique);

    /**
     * <desc>
     *   查询华为云下群控器所绑定的设备
     * </desc>
     *
     * @param controllerDeviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/08/10
     */
    String getDeviceUniqueBy(String controllerDeviceUnique);

    /**
     * <desc>
     *      京东上报通行记录
     * </desc>
     *
     * @param jdPassRecordDTO 京东通行记录VO
     * @return
     * @Author Zhu.yj
     * @createDate  2021/1/11
     */
    void reportPassRecord(JDPassRecordDTO jdPassRecordDTO) throws Exception;
}
